<!doctype html>
<html>
<head>
  <meta charset="utf-8"/>
  <meta http-equiv="X-UA-Compatible" content="IE=7; IE=EmulateIE9; IE=10" />
  <meta name="keywords" content="addPolygonToMap" />
  <title>HERE Maps API Example: Adding a Polygon</title>
  <!-- Set up constants such as APP ID and token -->
  <script type="text/javascript" src="libs/hereAppIdAndToken.js"></script>
  <!-- Bootstrap jQuery Library -->
  <script type="text/javascript" src="libs/jQl.min.js"></script>

  <!-- Asynchronously the HERE Maps API for JavaScript -->
  <script type="text/javascript" src="libs/hereAsyncLoader.js"
    id="HereMapsLoaderScript"
    data-map-container="mapContainer"
    data-params="maps"
    data-callback="afterHereMapLoad" >
  </script>
  <link rel="icon" href="http://here.com/favicon.ico"/>
  <!--<link href="http://developer.here.com/html/css/main.css" rel="stylesheet" />-->
</head>
<body>
  <h1>Adding a polygon to the map</h1>
  <div id="mapContainer" style="width:540px; height:334px;"></div>
<script id="example-code" data-categories="geoshape" type="text/javascript" >
//<![CDATA[
function addPolygonToMap(map) {
  var geoStrip = new nokia.maps.geo.Strip(
    [52, 13, 100, 48, 2, 100, 48, 16, 100, 52, 13, 100],
    'values lat lng alt'
  );
  map.objects.add(
    new nokia.maps.map.Polygon(geoStrip, {
      precision: 36,
      simplify: 16,
      fillColor: 'FFFFCC',
      color: '#829f',
      width: 8
    })
  );
}

function afterHereMapLoad(theMap) {
  var map = theMap;
  map.set('center', new nokia.maps.geo.Coordinate(53.1, 13.1));
  map.set('zoomLevel', 4);
  map.set('baseMapType', map.SATELLITE);
  addPolygonToMap(map);
}
//]]>
</script>
<script type="text/javascript" src="libs/prettyprint.js"></script>
</body>
</html>